import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.sql.*;
import javax.sound.sampled.*;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;
import javax.swing.*;

public class Calendar extends JPanel {
	
    String numberOfYear[];
    private int realYear, realMonth, realDay, currentYear, currentMonth;
    Boolean currentDate = false; //True if the date on the calendar displayed is the current date
    JPanel mainPanel;
    String[] months =  {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
    Connection con;
    private Clip currentSoundClip = null;
    private String setDate = null;
    
    Timer timer = new Timer (10, new TimerListener());
    
    public Calendar(JPanel panel) {
    	mainPanel = panel;
    	int  index = 0;
    	
        //Get the real month/year
    	GregorianCalendar cal = new GregorianCalendar(); //Create calendar
    	realDay = cal.get(GregorianCalendar.DAY_OF_MONTH); //Get day
    	realMonth = cal.get(GregorianCalendar.MONTH); //Get month
    	realYear = cal.get(GregorianCalendar.YEAR); //Get year
    	currentMonth = realMonth; //Match month and year
    	currentYear = realYear;

        for (int i=realYear-100; i<=realYear+100; i++){
            index ++;
        }

        numberOfYear = new String[index];
        index = 0;

        for (int i=realYear-100; i<=realYear+100; i++){
        	numberOfYear[index] = Integer.toString(i);
                index ++;
        }
        
        
        try {
            con = DriverManager.getConnection("jdbc:derby://localhost:1527/user", "user", "user");
            System.out.println("DB connected");
            
        } catch (SQLException ex) {
        	//Logger.getLogger(ConnectingDatabase.class.getName()).log(Level.SEVERE, null, ex);
        	System.out.println(ex.getMessage());
        }
        
        
        initComponents();
        
        refreshCalendar(realMonth,realYear);
        
        timer.start();
        
        setAlarmClockButton.addActionListener(new PanelSwitchToAlarmClockSetting());
        initDateToEntryMenu();
    }
    
    @SuppressWarnings("unchecked")
    private void initComponents() {

        datePanel = new JPanel();
        button1  = new JButton();
        button2  = new JButton();
        button3  = new JButton();
        button4  = new JButton();
        button5  = new JButton();
        button6  = new JButton();
        button7  = new JButton();
        button8  = new JButton();
        button15 = new JButton();
        button22 = new JButton();
        button29 = new JButton();
        button36 = new JButton();
        button9  = new JButton();
        button16 = new JButton();
        button23 = new JButton();
        button30 = new JButton();
        button37 = new JButton();
        button10 = new JButton();
        button17 = new JButton();
        button24 = new JButton();
        button31 = new JButton();
        button38 = new JButton();
        button11 = new JButton();
        button18 = new JButton();
        button25 = new JButton();
        button32 = new JButton();
        button39 = new JButton();
        button12 = new JButton();
        button19 = new JButton();
        button26 = new JButton();
        button33 = new JButton();
        button40 = new JButton();
        button14 = new JButton();
        button21 = new JButton();
        button28 = new JButton();
        button42 = new JButton();
        button35 = new JButton();
        button13 = new JButton();
        button20 = new JButton();
        button27 = new JButton();
        button34 = new JButton();
        button41 = new JButton();
        jPanel1  = new JPanel();
        jLabel2  = new JLabel();
        jLabel1  = new JLabel();
        jLabel3  = new JLabel();
        jLabel4  = new JLabel();
        jLabel5  = new JLabel();
        jLabel6  = new JLabel();
        jLabel7  = new JLabel();
        jLabel8  = new JLabel();
        monthText = new JLabel();
        nextMonthButton = new JButton();
        previousMonthButton = new JButton();
        yearComboBox = new JComboBox();
        setAlarmClockButton = new JButton();
        soundSettingsButton = new JButton();
        exitProgramButton = new JButton();
        timeDisplayLabel = new JLabel();
        legendPanel = new JPanel();
        pinkPanel1 = new JPanel();
        redPanel = new JPanel();
        jLabel9 = new JLabel();
        jLabel10 = new JLabel();
        jLabel11 = new JLabel();
        greenPanel = new JPanel();
        jLabel12 = new JLabel();
        refreshCalendarButton = new JButton();
        
        datePanel.setBorder(null);

        button1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button1ActionPerformed(evt);
            }
        });

        button2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button2ActionPerformed(evt);
            }
        });

        button3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button3ActionPerformed(evt);
            }
        });

        button4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button4ActionPerformed(evt);
            }
        });

        button5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button5ActionPerformed(evt);
            }
        });

        button6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button6ActionPerformed(evt);
            }
        });

        button7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button7ActionPerformed(evt);
            }
        });

        button8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button8ActionPerformed(evt);
            }
        });

        button15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button15ActionPerformed(evt);
            }
        });

        button22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button22ActionPerformed(evt);
            }
        });

        button29.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button29ActionPerformed(evt);
            }
        });

        button36.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button36ActionPerformed(evt);
            }
        });

        button9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button9ActionPerformed(evt);
            }
        });

        button16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button16ActionPerformed(evt);
            }
        });

        button23.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button23ActionPerformed(evt);
            }
        });

        button30.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button30ActionPerformed(evt);
            }
        });

        button37.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button37ActionPerformed(evt);
            }
        });

        button10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button10ActionPerformed(evt);
            }
        });

        button17.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button17ActionPerformed(evt);
            }
        });

        button24.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button24ActionPerformed(evt);
            }
        });

        button31.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button31ActionPerformed(evt);
            }
        });

        button38.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button38ActionPerformed(evt);
            }
        });

        button11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button11ActionPerformed(evt);
            }
        });

        button18.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button18ActionPerformed(evt);
            }
        });

        button25.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button25ActionPerformed(evt);
            }
        });

        button32.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button32ActionPerformed(evt);
            }
        });

        button39.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button39ActionPerformed(evt);
            }
        });

        button12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button12ActionPerformed(evt);
            }
        });

        button19.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button19ActionPerformed(evt);
            }
        });

        button26.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button26ActionPerformed(evt);
            }
        });

        button33.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button33ActionPerformed(evt);
            }
        });

        button40.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button40ActionPerformed(evt);
            }
        });

        button14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button14ActionPerformed(evt);
            }
        });

        button21.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button21ActionPerformed(evt);
            }
        });

        button28.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button28ActionPerformed(evt);
            }
        });

        button42.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button42ActionPerformed(evt);
            }
        });

        button35.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button35ActionPerformed(evt);
            }
        });

        button13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button13ActionPerformed(evt);
            }
        });

        button20.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button20ActionPerformed(evt);
            }
        });

        button27.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button27ActionPerformed(evt);
            }
        });

        button34.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button34ActionPerformed(evt);
            }
        });

        button41.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button41ActionPerformed(evt);
            }
        });
        
        
        javax.swing.GroupLayout datePanelLayout = new javax.swing.GroupLayout(datePanel);
        datePanel.setLayout(datePanelLayout);
        datePanelLayout.setHorizontalGroup(
            datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(datePanelLayout.createSequentialGroup()
                .addGroup(datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(datePanelLayout.createSequentialGroup()
                        .addComponent(button1, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button2, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button3, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button4, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button5, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button6, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(datePanelLayout.createSequentialGroup()
                        .addComponent(button8, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button9, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button10, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button11, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button12, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button13, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(datePanelLayout.createSequentialGroup()
                        .addComponent(button15, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button16, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button17, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button18, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button19, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button20, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(datePanelLayout.createSequentialGroup()
                        .addComponent(button22, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button23, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button24, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button25, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button26, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button27, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(datePanelLayout.createSequentialGroup()
                        .addComponent(button29, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button30, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button31, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button32, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button33, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button34, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(datePanelLayout.createSequentialGroup()
                        .addComponent(button36, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button37, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button38, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button39, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button40, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(button41, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(button14, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button21, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button28, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button35, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button42, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button7, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        datePanelLayout.setVerticalGroup(
            datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(datePanelLayout.createSequentialGroup()
                .addGroup(datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(button1, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button2, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button3, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button4, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button5, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button6, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button7, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(datePanelLayout.createSequentialGroup()
                        .addGroup(datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(button8, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button9, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button10, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button11, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button12, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button13, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(button15, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button16, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button17, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button18, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button19, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button20, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(button22, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button23, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button24, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button25, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button26, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button27, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(datePanelLayout.createSequentialGroup()
                                .addGroup(datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(button32, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(button31, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(button29, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(button30, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(button33, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(button40, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(button36, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(button38, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(button39, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(button37, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(button34, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(datePanelLayout.createSequentialGroup()
                        .addComponent(button14, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button21, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button28, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button35, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(button41, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(button42, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        jLabel2.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        jLabel2.setText("TUES");

        jLabel1.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        jLabel1.setText("MON");

        jLabel3.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        jLabel3.setText("WED");

        jLabel4.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        jLabel4.setText("THURS");

        jLabel5.setFont(new java.awt.Font("DejaVu Sans", 0, 14)); // NOI18N
        jLabel5.setText("FRI");

        jLabel6.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
        jLabel6.setText("SAT");

        jLabel7.setFont(new java.awt.Font("DejaVu Sans", 0, 14)); // NOI18N
        jLabel7.setText("SUN");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
                .addComponent(jLabel2)
                .addGap(46, 46, 46)
                .addComponent(jLabel3)
                .addGap(39, 39, 39)
                .addComponent(jLabel4)
                .addGap(49, 49, 49)
                .addComponent(jLabel5)
                .addGap(56, 56, 56)
                .addComponent(jLabel6)
                .addGap(56, 56, 56)
                .addComponent(jLabel7)
                .addGap(22, 22, 22))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jLabel6)
                    .addComponent(jLabel5)
                    .addComponent(jLabel4)
                    .addComponent(jLabel3)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1)))
        );

        jLabel8.setFont(new java.awt.Font("DejaVu Sans", 1, 36)); // NOI18N
        jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel8.setText("Electronic Diary");

        monthText.setFont(new java.awt.Font("DejaVu Sans", 1, 18)); // NOI18N
        monthText.setText("October");

        nextMonthButton.setText(">>");
        nextMonthButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nextMonthButtonActionPerformed(evt);
            }
        });

        previousMonthButton.setText("<<");
        previousMonthButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                previousMonthButtonActionPerformed(evt);
            }
        });

        yearComboBox.setModel(new javax.swing.DefaultComboBoxModel( numberOfYear ));
        yearComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                yearComboBoxActionPerformed(evt);
            }
        });
        
        refreshCalendarButton.setText("[Refresh Calendar]");
        refreshCalendarButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
           	 refreshCalendarButtonActionPerformed(evt);
           }
       });
        
        setAlarmClockButton.setFont(new java.awt.Font("DejaVu Sans", 0, 14)); // NOI18N
        setAlarmClockButton.setText("Set Alarm Clock");

        soundSettingsButton.setFont(new java.awt.Font("DejaVu Sans", 0, 14)); // NOI18N
        soundSettingsButton.setText("Sound Settings");
        soundSettingsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	 soundSettingsButtonActionPerformed(evt);
            }
        });

        exitProgramButton.setFont(new java.awt.Font("DejaVu Sans", 0, 14)); // NOI18N
        exitProgramButton.setText("Exit Program");
        exitProgramButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitProgramButtonActionPerformed(evt);
            }
        });

        timeDisplayLabel.setFont(new java.awt.Font("DejaVu Sans", 1, 14)); // NOI18N
        timeDisplayLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);

        pinkPanel1.setBackground(java.awt.Color.pink);

        javax.swing.GroupLayout pinkPanel1Layout = new javax.swing.GroupLayout(pinkPanel1);
        pinkPanel1.setLayout(pinkPanel1Layout);
        pinkPanel1Layout.setHorizontalGroup(
            pinkPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 17, Short.MAX_VALUE)
        );
        pinkPanel1Layout.setVerticalGroup(
            pinkPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 15, Short.MAX_VALUE)
        );

        redPanel.setBackground(java.awt.Color.red);

        javax.swing.GroupLayout redPanelLayout = new javax.swing.GroupLayout(redPanel);
        redPanel.setLayout(redPanelLayout);
        redPanelLayout.setHorizontalGroup(
            redPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 17, Short.MAX_VALUE)
        );
        redPanelLayout.setVerticalGroup(
            redPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 15, Short.MAX_VALUE)
        );

        jLabel9.setFont(new java.awt.Font("DejaVu Sans", 0, 12)); // NOI18N
        jLabel9.setText("Has Entry");

        jLabel10.setFont(new java.awt.Font("DejaVu Sans", 0, 12)); // NOI18N
        jLabel10.setText("Current Day");

        jLabel11.setFont(new java.awt.Font("DejaVu Sans", 3, 12)); // NOI18N
        jLabel11.setText("Legend:");

        greenPanel.setBackground(java.awt.Color.green);

        javax.swing.GroupLayout greenPanelLayout = new javax.swing.GroupLayout(greenPanel);
        greenPanel.setLayout(greenPanelLayout);
        greenPanelLayout.setHorizontalGroup(
            greenPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 17, Short.MAX_VALUE)
        );
        greenPanelLayout.setVerticalGroup(
            greenPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 15, Short.MAX_VALUE)
        );

        jLabel12.setFont(new java.awt.Font("DejaVu Sans", 0, 12)); // NOI18N
        jLabel12.setText("Current Day and has Entry");

        javax.swing.GroupLayout legendPanelLayout = new javax.swing.GroupLayout(legendPanel);
        legendPanel.setLayout(legendPanelLayout);
        legendPanelLayout.setHorizontalGroup(
            legendPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(legendPanelLayout.createSequentialGroup()
                .addGroup(legendPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(legendPanelLayout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addGap(139, 139, 139))
                    .addGroup(legendPanelLayout.createSequentialGroup()
                        .addGroup(legendPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(pinkPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(redPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(greenPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(legendPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE)
                            .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE)
                            .addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE))))
                .addContainerGap())
        );
        legendPanelLayout.setVerticalGroup(
            legendPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(legendPanelLayout.createSequentialGroup()
                .addComponent(jLabel11)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(legendPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(pinkPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel10))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(legendPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(redPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel9))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(legendPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(legendPanelLayout.createSequentialGroup()
                        .addComponent(greenPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(22, 22, 22))
                    .addGroup(legendPanelLayout.createSequentialGroup()
                        .addComponent(jLabel12)
                        .addContainerGap())))
        );
        
        
        
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(datePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(110, 110, 110)
                        .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 343, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(timeDisplayLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(previousMonthButton)
                            .addGap(176, 176, 176)
                            .addComponent(monthText)
                            .addGap(20, 20, 20)
                            .addComponent(yearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(nextMonthButton))
                        .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(setAlarmClockButton)
                        .addGap(85, 85, 85)
                        .addComponent(soundSettingsButton)
                        .addGap(81, 81, 81)
                        .addComponent(exitProgramButton))
                    .addGroup(layout.createSequentialGroup()
                    	.addComponent(refreshCalendarButton)
                        .addGap(202, 202, 202)
                        .addComponent(legendPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(37, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8)
                    .addComponent(timeDisplayLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(previousMonthButton, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(monthText, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(yearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(nextMonthButton, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(14, 14, 14)
                .addComponent(datePanel, javax.swing.GroupLayout.PREFERRED_SIZE, 324, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(legendPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(refreshCalendarButton)).addGap(6, 6, 6)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(soundSettingsButton)
                    .addComponent(exitProgramButton)
                    .addComponent(setAlarmClockButton))
                .addContainerGap(29, Short.MAX_VALUE))
        );
    }
    
    //Initialise all the buttons in the calendar part to connect to the Entry Menu
    private void initDateToEntryMenu() {
    	button1.addActionListener(new PanelSwitchToEntryMenu());
        button2.addActionListener(new PanelSwitchToEntryMenu());
        button3.addActionListener(new PanelSwitchToEntryMenu());
        button4.addActionListener(new PanelSwitchToEntryMenu());
        button5.addActionListener(new PanelSwitchToEntryMenu());
        button6.addActionListener(new PanelSwitchToEntryMenu());
        button7.addActionListener(new PanelSwitchToEntryMenu());
        button8.addActionListener(new PanelSwitchToEntryMenu());
        button9.addActionListener(new PanelSwitchToEntryMenu());
        button10.addActionListener(new PanelSwitchToEntryMenu());
        button11.addActionListener(new PanelSwitchToEntryMenu());
        button12.addActionListener(new PanelSwitchToEntryMenu());
        button13.addActionListener(new PanelSwitchToEntryMenu());
        button14.addActionListener(new PanelSwitchToEntryMenu());
        button15.addActionListener(new PanelSwitchToEntryMenu());
        button16.addActionListener(new PanelSwitchToEntryMenu());
        button17.addActionListener(new PanelSwitchToEntryMenu());
        button18.addActionListener(new PanelSwitchToEntryMenu());
        button19.addActionListener(new PanelSwitchToEntryMenu());
        button20.addActionListener(new PanelSwitchToEntryMenu());
        button21.addActionListener(new PanelSwitchToEntryMenu());
        button22.addActionListener(new PanelSwitchToEntryMenu());
        button23.addActionListener(new PanelSwitchToEntryMenu());
        button24.addActionListener(new PanelSwitchToEntryMenu());
        button25.addActionListener(new PanelSwitchToEntryMenu());
        button26.addActionListener(new PanelSwitchToEntryMenu());
        button27.addActionListener(new PanelSwitchToEntryMenu());
        button28.addActionListener(new PanelSwitchToEntryMenu());
        button29.addActionListener(new PanelSwitchToEntryMenu());
        button30.addActionListener(new PanelSwitchToEntryMenu());
        button31.addActionListener(new PanelSwitchToEntryMenu());
        button32.addActionListener(new PanelSwitchToEntryMenu());
        button33.addActionListener(new PanelSwitchToEntryMenu());
        button34.addActionListener(new PanelSwitchToEntryMenu());
        button35.addActionListener(new PanelSwitchToEntryMenu());
        button36.addActionListener(new PanelSwitchToEntryMenu());
        button37.addActionListener(new PanelSwitchToEntryMenu());
        button38.addActionListener(new PanelSwitchToEntryMenu());
        button39.addActionListener(new PanelSwitchToEntryMenu());
        button40.addActionListener(new PanelSwitchToEntryMenu());
        button41.addActionListener(new PanelSwitchToEntryMenu());
        button42.addActionListener(new PanelSwitchToEntryMenu());
    }
    
    
    private void refreshCalendarButtonActionPerformed(ActionEvent evt) { 
    	refreshCalendar(currentMonth,currentYear);
    }
    
    
    private void yearComboBoxActionPerformed(ActionEvent evt) {
        if (yearComboBox.getSelectedItem() != null){
        	String b = yearComboBox.getSelectedItem().toString();
        	currentYear = Integer.parseInt(b);
        	refreshCalendar(currentMonth, currentYear);
        }
    }                                            

    private void nextMonthButtonActionPerformed(ActionEvent evt) {
        if (currentMonth == 11){ //Forward one year
            currentMonth = 0;
            currentYear += 1;
        } else{ //Forward one month
            currentMonth += 1;
        }
        refreshCalendar(currentMonth, currentYear);
    }                                               

    private void previousMonthButtonActionPerformed(ActionEvent evt) {
        if (currentMonth == 0){ //Back one year
            currentMonth = 11;
            currentYear -= 1;
        } else{ //Back one month
            currentMonth -= 1;
        }
        refreshCalendar(currentMonth, currentYear);
    }                                                   

    private void soundSettingsButtonActionPerformed(ActionEvent evt) {
    	NewSOundSetting setting = new NewSOundSetting();
    	setting.setVisible(true);
    }
    
    
    private void exitProgramButtonActionPerformed(ActionEvent evt) {
    	int exit = JOptionPane.showConfirmDialog(this,"Quit Program? ","Exit",JOptionPane.YES_NO_OPTION);
        if(exit == JOptionPane.YES_NO_OPTION){
        	try {
        		timer.stop();
        		con.close();
        		System.out.println("Database Connection Terminated");
        	}
        	catch (SQLException ex) {
        		System.out.println(ex.getMessage());
        	}
    	
        	System.exit(0);
        }
    }
    
    private void button1ActionPerformed(ActionEvent evt) {
    	if(button1.getText() != null) {
    		EntryMenu.dateLabel.setText(button1.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button1.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button2ActionPerformed(ActionEvent evt) {
    	if(button2.getText() != null) {
    		EntryMenu.dateLabel.setText(button2.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button2.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button3ActionPerformed(ActionEvent evt) {
    	if(button3.getText() != null) {
    		EntryMenu.dateLabel.setText(button3.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button3.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button4ActionPerformed(ActionEvent evt) {
    	if(button4.getText() != null) {
    		EntryMenu.dateLabel.setText(button4.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button4.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button5ActionPerformed(ActionEvent evt) {
    	if(button5.getText() != null) {
    		EntryMenu.dateLabel.setText(button5.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button5.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button6ActionPerformed(ActionEvent evt) {
    	if(button6.getText() != null) {
    		EntryMenu.dateLabel.setText(button6.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button6.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button7ActionPerformed(ActionEvent evt) {
    	if(button7.getText() != null) {
    		EntryMenu.dateLabel.setText(button7.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button7.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button8ActionPerformed(ActionEvent evt) {
    	if(button8.getText() != null) {
    		EntryMenu.dateLabel.setText(button8.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button8.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button9ActionPerformed(ActionEvent evt) {
    	if(button9.getText() != null) {
    		EntryMenu.dateLabel.setText(button9.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button9.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button10ActionPerformed(ActionEvent evt) {
    	if(button10.getText() != null) {
    		EntryMenu.dateLabel.setText(button10.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button10.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button11ActionPerformed(ActionEvent evt) {
    	if(button11.getText() != null) {
    		EntryMenu.dateLabel.setText(button11.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button11.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button12ActionPerformed(ActionEvent evt) {
    	if(button12.getText() != null) {
    		EntryMenu.dateLabel.setText(button12.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button12.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button13ActionPerformed(ActionEvent evt) {
    	if(button13.getText() != null) {
    		EntryMenu.dateLabel.setText(button13.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button13.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button14ActionPerformed(ActionEvent evt) {
    	if(button14.getText() != null) {
    		EntryMenu.dateLabel.setText(button14.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button14.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button15ActionPerformed(ActionEvent evt) {
    	if(button15.getText() != null) {
    		EntryMenu.dateLabel.setText(button15.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button15.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button16ActionPerformed(ActionEvent evt) {
    	if(button16.getText() != null) {
    		EntryMenu.dateLabel.setText(button16.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button16.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button17ActionPerformed(ActionEvent evt) {
    	if(button17.getText() != null) {
    		EntryMenu.dateLabel.setText(button17.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button17.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button18ActionPerformed(ActionEvent evt) {
    	if(button18.getText() != null) {
    		EntryMenu.dateLabel.setText(button18.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button18.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button19ActionPerformed(ActionEvent evt) {
    	if(button19.getText() != null) {
    		EntryMenu.dateLabel.setText(button19.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button19.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button20ActionPerformed(ActionEvent evt) {
    	if(button20.getText() != null) {
    		EntryMenu.dateLabel.setText(button20.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button20.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button21ActionPerformed(ActionEvent evt) {
    	if(button21.getText() != null) {
    		EntryMenu.dateLabel.setText(button21.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button21.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button22ActionPerformed(ActionEvent evt) {
    	if(button22.getText() != null) {
    		EntryMenu.dateLabel.setText(button22.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button22.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button23ActionPerformed(ActionEvent evt) {
    	if(button2.getText() != null) {
    		EntryMenu.dateLabel.setText(button2.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button2.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button24ActionPerformed(ActionEvent evt) {
    	if(button2.getText() != null) {
    		EntryMenu.dateLabel.setText(button2.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button2.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button25ActionPerformed(ActionEvent evt) {
    	if(button25.getText() != null) {
    		EntryMenu.dateLabel.setText(button25.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button25.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button26ActionPerformed(ActionEvent evt) {
    	if(button26.getText() != null) {
    		EntryMenu.dateLabel.setText(button26.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button26.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button27ActionPerformed(ActionEvent evt) {
    	if(button27.getText() != null) {
    		EntryMenu.dateLabel.setText(button27.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button27.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button28ActionPerformed(ActionEvent evt) {
    	if(button28.getText() != null) {
    		EntryMenu.dateLabel.setText(button28.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button28.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button29ActionPerformed(ActionEvent evt) {
    	if(button29.getText() != null) {
    		EntryMenu.dateLabel.setText(button29.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button29.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button30ActionPerformed(ActionEvent evt) {
    	if(button30.getText() != null) {
    		EntryMenu.dateLabel.setText(button30.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button30.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button31ActionPerformed(ActionEvent evt) {
    	if(button31.getText() != null) {
    		EntryMenu.dateLabel.setText(button31.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button31.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button32ActionPerformed(ActionEvent evt) {
    	if(button32.getText() != null) {
    		EntryMenu.dateLabel.setText(button32.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button32.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button33ActionPerformed(ActionEvent evt) {
    	if(button33.getText() != null) {
    		EntryMenu.dateLabel.setText(button33.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button33.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button34ActionPerformed(ActionEvent evt) {
    	if(button34.getText() != null) {
    		EntryMenu.dateLabel.setText(button34.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button34.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button35ActionPerformed(ActionEvent evt) {
    	if(button35.getText() != null) {
    		EntryMenu.dateLabel.setText(button35.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button35.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button36ActionPerformed(ActionEvent evt) {
    	if(button36.getText() != null) {
    		EntryMenu.dateLabel.setText(button36.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button36.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button37ActionPerformed(ActionEvent evt) {
    	if(button37.getText() != null) {
    		EntryMenu.dateLabel.setText(button37.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button37.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button38ActionPerformed(ActionEvent evt) {
    	if(button38.getText() != null) {
    		EntryMenu.dateLabel.setText(button38.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button38.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button39ActionPerformed(ActionEvent evt) {
    	if(button39.getText() != null) {
    		EntryMenu.dateLabel.setText(button39.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button39.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button40ActionPerformed(ActionEvent evt) {
    	if(button40.getText() != null) {
    		EntryMenu.dateLabel.setText(button40.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button40.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button41ActionPerformed(ActionEvent evt) {
    	if(button41.getText() != null) {
    		EntryMenu.dateLabel.setText(button41.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button41.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }

    private void button42ActionPerformed(ActionEvent evt) {
    	if(button42.getText() != null) {
    		EntryMenu.dateLabel.setText(button42.getText() + " " + months[currentMonth]+ " " + currentYear);
    		setDate = Integer.toString(currentMonth + 1) + "/" + button42.getText() + "/" + currentYear;
    		setDateForGUI(setDate);
    	}
    }
    
    //Refresh the calendar part
    private void refreshCalendar(int month, int year){
    	int numberOfDays, startOfMonth;

    	if (month == 0 && year <= realYear-10) {
            previousMonthButton.setEnabled(false);
        } //Too early
    	if (month == 11 && year >= realYear+100) {
            nextMonthButton.setEnabled(false);
        } //Too late

    	monthText.setText(months[month]); //Refresh the month label (at the top)
        yearComboBox.setSelectedItem(String.valueOf(year)); //Select the correct year in the combo box

        //Clear the date buttons
        clearDate();
        currentDate = false;
        
        currentMonth = month;
        currentYear = year;

        //Get first day of month and number of days
        GregorianCalendar cal = new GregorianCalendar(year, month, 1);
        numberOfDays = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);

        //StartOfMonth is taken where Sunday is the first day of the week
        startOfMonth = cal.get(GregorianCalendar.DAY_OF_WEEK);
        
        disableButtons();
        
        //Draw calendar
        for (int i=1; i<=numberOfDays; i++){
        	int row = new Integer((i+startOfMonth-3)/7);
        	int column  =  (i+startOfMonth-2)%7;
            String loop = Integer.toString(i); //Convert the date to String to be displayed on the button
            
            displayDate(row,column,loop);
        }
    }

    //Clear the button's text and restore the button's original background colour
    private void clearDate() {
        button1.setText(null);
        button1.setBackground(getBackground());
        button2.setText(null);
        button2.setBackground(getBackground());
        button3.setText(null);
        button3.setBackground(getBackground());
        button4.setText(null);
        button4.setBackground(getBackground());
        button5.setText(null);
        button5.setBackground(getBackground());
        button6.setText(null);
        button6.setBackground(getBackground());
        button7.setText(null);
        button7.setBackground(getBackground());
        button8.setText(null);
        button8.setBackground(getBackground());
        button9.setText(null);
        button9.setBackground(getBackground());
        button10.setText(null);
        button10.setBackground(getBackground());
        button11.setText(null);
        button11.setBackground(getBackground());
        button12.setText(null);
        button12.setBackground(getBackground());
        button13.setText(null);
        button13.setBackground(getBackground());
        button14.setText(null);
        button14.setBackground(getBackground());
        button15.setText(null);
        button15.setBackground(getBackground());
        button16.setText(null);
        button16.setBackground(getBackground());
        button17.setText(null);
        button17.setBackground(getBackground());
        button18.setText(null);
        button18.setBackground(getBackground());
        button19.setText(null);
        button19.setBackground(getBackground());
        button20.setText(null);
        button20.setBackground(getBackground());
        button21.setText(null);
        button21.setBackground(getBackground());
        button22.setText(null);
        button22.setBackground(getBackground());
        button23.setText(null);
        button23.setBackground(getBackground());
        button24.setText(null);
        button24.setBackground(getBackground());
        button25.setText(null);
        button25.setBackground(getBackground());
        button26.setText(null);
        button26.setBackground(getBackground());
        button27.setText(null);
        button27.setBackground(getBackground());
        button28.setText(null);
        button28.setBackground(getBackground());
        button29.setText(null);
        button29.setBackground(getBackground());
        button30.setText(null);
        button30.setBackground(getBackground());
        button31.setText(null);
        button31.setBackground(getBackground());
        button32.setText(null);
        button32.setBackground(getBackground());
        button33.setText(null);
        button33.setBackground(getBackground());
        button34.setText(null);
        button34.setBackground(getBackground());
        button35.setText(null);
        button35.setBackground(getBackground());
        button36.setText(null);
        button36.setBackground(getBackground());
        button37.setText(null);
        button37.setBackground(getBackground());
        button38.setText(null);
        button38.setBackground(getBackground());
        button39.setText(null);
        button39.setBackground(getBackground());
        button40.setText(null);
        button30.setBackground(getBackground());
        button41.setText(null);
        button41.setBackground(getBackground());
        button42.setText(null);
        button42.setBackground(getBackground());
    }

    //Disable or the buttons (date) in the calendar portion
    private void disableButtons() {
    	button1.setEnabled(false);
    	button2.setEnabled(false);
    	button3.setEnabled(false);
    	button4.setEnabled(false);
    	button5.setEnabled(false);
    	button6.setEnabled(false);
    	button7.setEnabled(false);
    	button8.setEnabled(false);
    	button9.setEnabled(false);
    	button10.setEnabled(false);
    	button11.setEnabled(false);
    	button12.setEnabled(false);
    	button13.setEnabled(false);
    	button14.setEnabled(false);
    	button15.setEnabled(false);
    	button16.setEnabled(false);
    	button17.setEnabled(false);
    	button18.setEnabled(false);
    	button19.setEnabled(false);
    	button20.setEnabled(false);
    	button21.setEnabled(false);
    	button22.setEnabled(false);
    	button23.setEnabled(false);
    	button24.setEnabled(false);
    	button25.setEnabled(false);
    	button26.setEnabled(false);
    	button27.setEnabled(false);
    	button28.setEnabled(false);
    	button29.setEnabled(false);
    	button30.setEnabled(false);
    	button31.setEnabled(false);
    	button32.setEnabled(false);
    	button33.setEnabled(false);
    	button34.setEnabled(false);
    	button35.setEnabled(false);
    	button36.setEnabled(false);
    	button37.setEnabled(false);
    	button38.setEnabled(false);
    	button39.setEnabled(false);
    	button40.setEnabled(false);
    	button41.setEnabled(false);
    	button42.setEnabled(false);
    }
    
    //Populates the button according to the date
    //Highlight the current day the days that have entries
    private void displayDate(int row, int column, String loop) {
    	Boolean entry = false;
    	
        //Check for the current date
        if(currentYear == realYear && currentMonth == realMonth && Integer.parseInt(loop) == realDay)
            currentDate = true;
        else
            currentDate = false;
        
        try {
            String dateCompare = null;
            dateCompare = currentYear + "-" + Integer.toString(currentMonth + 1) + "-" + loop;
            
            Statement stmt = con.createStatement();
            ResultSet rset = stmt.executeQuery("SELECT * FROM ENTRY WHERE E_DATE = '" + dateCompare + "'");
            
            //This loop is executed only if there is a row in the database that fits the SQL statement
            while(rset.next()) {
            	entry = true;
            }
            stmt.close();
        } catch (SQLException ex) {
        	System.out.println("ERRPR => " + ex.getMessage());
        }
        
        if(row == 0) {
            if(column == 1) {
                button1.setText(loop);
                button1.setEnabled(true);
                if(currentDate == true && entry == false)
                    button1.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button1.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button1.setBackground(Color.GREEN);
            }
            else if(column == 2) {
                button2.setText(loop);
                button2.setEnabled(true);
                if(currentDate == true && entry == false)
                    button2.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button2.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button2.setBackground(Color.GREEN);
            }
            else if(column == 3) {
                button3.setText(loop);
                button3.setEnabled(true);
                if(currentDate == true && entry == false)
                    button3.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button3.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button3.setBackground(Color.GREEN);
            }
            else if(column == 4) {
                button4.setText(loop);
                button4.setEnabled(true);
                if(currentDate == true && entry == false)
                    button4.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button4.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button4.setBackground(Color.GREEN);
            }
            else if(column == 5) {
                button5.setText(loop);
                button5.setEnabled(true);
                if(currentDate == true && entry == false)
                    button5.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button5.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button5.setBackground(Color.GREEN);
            }
            else if(column == 6) {
                button6.setText(loop);
                button6.setEnabled(true);
                if(currentDate == true && entry == false)
                    button6.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button6.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button6.setBackground(Color.GREEN);
            }
            else if(column == 0) {
                button7.setText(loop);
                button7.setEnabled(true);
                if(currentDate == true && entry == false)
                    button7.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button7.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button7.setBackground(Color.GREEN);
            }
        }
        else if(row == 1) {
            if(column == 1) {
                button8.setText(loop);
                button8.setEnabled(true);
                if(currentDate == true && entry == false)
                    button8.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button8.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button8.setBackground(Color.GREEN);
            }
            else if(column == 2) {
                button9.setText(loop);
                button9.setEnabled(true);
                if(currentDate == true && entry == false)
                    button9.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button9.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button9.setBackground(Color.GREEN);
            }
            else if(column == 3) {
                button10.setText(loop);
                button10.setEnabled(true);
                if(currentDate == true && entry == false)
                    button10.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button10.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button10.setBackground(Color.GREEN);
            }
            else if(column == 4) {
                button11.setText(loop);
                button11.setEnabled(true);
                if(currentDate == true && entry == false)
                    button11.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button11.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button11.setBackground(Color.GREEN);
            }
            else if(column == 5) {
                button12.setText(loop);
                button12.setEnabled(true);
                if(currentDate == true && entry == false)
                    button12.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button12.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button12.setBackground(Color.GREEN);
            }
            else if(column == 6) {
                button13.setText(loop);
                button13.setEnabled(true);
                if(currentDate == true && entry == false)
                    button13.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button13.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button13.setBackground(Color.GREEN);
            }
            else if(column == 0) {
                button14.setText(loop);
                button14.setEnabled(true);
                if(currentDate == true && entry == false)
                    button14.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button14.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button14.setBackground(Color.GREEN);
            }
        }
        else if(row == 2) {
            if(column == 1) {
                button15.setText(loop);
                button15.setEnabled(true);
                if(currentDate == true && entry == false)
                    button15.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button15.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button15.setBackground(Color.GREEN);
            }
            else if(column == 2) {
                button16.setText(loop);
                button16.setEnabled(true);
                if(currentDate == true && entry == false)
                    button16.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button16.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button16.setBackground(Color.GREEN);
            }
            else if(column == 3) {
                button17.setText(loop);
                button17.setEnabled(true);
                if(currentDate == true && entry == false)
                    button17.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button17.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button17.setBackground(Color.GREEN);
            }
            else if(column == 4) {
                button18.setText(loop);
                button18.setEnabled(true);
                if(currentDate == true && entry == false)
                    button18.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button18.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button18.setBackground(Color.GREEN);
            }
            else if(column == 5) {
                button19.setText(loop);
                button19.setEnabled(true);
                if(currentDate == true && entry == false)
                    button19.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button19.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button19.setBackground(Color.GREEN);
            }
            else if(column == 6) {
                button20.setText(loop);
                button20.setEnabled(true);
                if(currentDate == true && entry == false)
                    button20.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button20.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button20.setBackground(Color.GREEN);
            }
            else if(column == 0) {
                button21.setText(loop);
                button21.setEnabled(true);
                if(currentDate == true && entry == false)
                    button21.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button21.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button21.setBackground(Color.GREEN);
            }
        }
        else if(row == 3) {
            if(column == 1) {
                button22.setText(loop);
                button22.setEnabled(true);
                if(currentDate == true && entry == false)
                    button22.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button22.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button22.setBackground(Color.GREEN);
            }
            else if(column == 2) {
                button23.setText(loop);
                button23.setEnabled(true);
                if(currentDate == true && entry == false)
                    button23.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button23.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button23.setBackground(Color.GREEN);
            }
            else if(column == 3) {
                button24.setText(loop);
                button24.setEnabled(true);
                if(currentDate == true && entry == false)
                    button24.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button24.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button24.setBackground(Color.GREEN);
            }
            else if(column == 4) {
                button25.setText(loop);
                button25.setEnabled(true);
                if(currentDate == true && entry == false)
                    button25.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button25.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button25.setBackground(Color.GREEN);
            }
            else if(column == 5) {
                button26.setText(loop);
                button26.setEnabled(true);
                if(currentDate == true && entry == false)
                    button26.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button26.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button26.setBackground(Color.GREEN);
            }
            else if(column == 6) {
                button27.setText(loop);
                button27.setEnabled(true);
                if(currentDate == true && entry == false)
                    button27.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button27.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button27.setBackground(Color.GREEN);
            }
            else if(column == 0) {
                button28.setText(loop);
                button28.setEnabled(true);
                if(currentDate == true && entry == false)
                    button28.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button28.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button28.setBackground(Color.GREEN);
            }
        }
        else if(row == 4) {
            if(column == 1) {
                button29.setText(loop);
                button29.setEnabled(true);
                if(currentDate == true && entry == false)
                    button29.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button29.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button29.setBackground(Color.GREEN);
            }
            else if(column == 2) {
                button30.setText(loop);
                button30.setEnabled(true);
                if(currentDate == true && entry == false)
                    button30.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button30.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button30.setBackground(Color.GREEN);
            }
            else if(column == 3) {
                button31.setText(loop);
                button31.setEnabled(true);
                if(currentDate == true && entry == false)
                    button31.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button31.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button31.setBackground(Color.GREEN);
            }
            else if(column == 4) {
                button32.setText(loop);
                button32.setEnabled(true);
                if(currentDate == true && entry == false)
                    button32.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button32.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button32.setBackground(Color.GREEN);
            }
            else if(column == 5) {
                button33.setText(loop);
                button33.setEnabled(true);
                if(currentDate == true && entry == false)
                    button33.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button33.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button33.setBackground(Color.GREEN);
            }
            else if(column == 6) {
                button34.setText(loop);
                button34.setEnabled(true);
                if(currentDate == true && entry == false)
                    button34.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button34.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button34.setBackground(Color.GREEN);
            }
            else if(column == 0) {
                button35.setText(loop);
                button35.setEnabled(true);
                if(currentDate == true && entry == false)
                    button35.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button35.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button35.setBackground(Color.GREEN);
            }
        }
        else if(row == 5) {
            if(column == 1) {
                button36.setText(loop);
                button36.setEnabled(true);
                if(currentDate == true && entry == false)
                    button36.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button36.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button36.setBackground(Color.GREEN);
            }
            else if(column == 2) {
                button37.setText(loop);
                button37.setEnabled(true);
                if(currentDate == true && entry == false)
                    button37.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button37.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button37.setBackground(Color.GREEN);
            }
            else if(column == 3) {
                button38.setText(loop);
                button38.setEnabled(true);
                if(currentDate == true && entry == false)
                    button38.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button38.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button38.setBackground(Color.GREEN);
            }
            else if(column == 4) {
                button39.setText(loop);
                button39.setEnabled(true);
                if(currentDate == true && entry == false)
                    button39.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button39.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button39.setBackground(Color.GREEN);
            }
            else if(column == 5) {
                button40.setText(loop);
                button40.setEnabled(true);
                if(currentDate == true && entry == false)
                    button40.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button40.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button40.setBackground(Color.GREEN);
            }
            else if(column == 6) {
                button41.setText(loop);
                button41.setEnabled(true);
                if(currentDate == true && entry == false)
                    button41.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button41.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button41.setBackground(Color.GREEN);
            }
            else if(column == 0) {
                button42.setText(loop);
                button42.setEnabled(true);
                if(currentDate == true && entry == false)
                    button42.setBackground(Color.PINK);
                else if(currentDate == false && entry == true)
                	button42.setBackground(Color.RED);
                else if(currentDate == true && entry == true)
                	button42.setBackground(Color.GREEN);
            }
        }
    }

    //Timer for the time display in the Calendar GUI
    private class TimerListener implements ActionListener{
 	   public void actionPerformed(ActionEvent evt){
 		   String timeCheck = null, title = null, timing = null, venue = null;
 		   java.util.Date getDate = null, reminderDate = null;
 		   
 		   java.util.Date currentDate = new java.util.Date();
 		   String displayTime = new SimpleDateFormat("HH:mm:ss").format(currentDate);
 		   String displayDate = new SimpleDateFormat("dd-MM-yyyy").format(currentDate);
 		   timeDisplayLabel.setText(displayTime);
 		   
 		   try {
 			   Statement stmt = con.createStatement();
 			   ResultSet rset = stmt.executeQuery("SELECT * FROM ENTRY");
 			   
 			   while(rset.next()) {
 				   title = rset.getString(2);
 				   reminderDate = rset.getDate(3);
 				   timing = rset.getString(4);
 				   venue = rset.getString(5);
 				   timeCheck = rset.getString(8);
 				   getDate = rset.getDate(7);
 			   
 				   
 				   String dateCheck = new SimpleDateFormat("dd-MM-yyyy").format(getDate);
 	 			   String reminderCheckDate = new SimpleDateFormat("dd-MM-yyyy").format(reminderDate);
 	 			   if(displayTime.equals(timeCheck) && displayDate.equals(dateCheck)) {
 	 				   //Start reading from the file
 	 				   String str = null, abc = null;
 	 				   try { BufferedReader in = new BufferedReader(new FileReader("RemindersongName"));
 	 				   		while ((str = in.readLine()) != null)
 	 				   		{ 
 	 				   			abc = str;
 	 				   		}//while end
 	 				   }//try end 
 	 				   catch (IOException e){
 	 					   System.out.println("error");  
 	 				   } 
 	 				   
 	 				   //Start playing song read
 	 				   String fileName = abc;
 	 				   File file = new File(fileName);
 	 				   try {
 	 			            AudioInputStream stream = AudioSystem.getAudioInputStream(file);
 	 			            AudioFormat format = stream.getFormat();

 	 			            if ((format.getEncoding() == AudioFormat.Encoding.ULAW) ||
 	 			                (format.getEncoding() == AudioFormat.Encoding.ALAW)) 
 	 			            {
 	 			                AudioFormat tmp = new AudioFormat(
 	 			                                          AudioFormat.Encoding.PCM_SIGNED, 
 	 			                                          format.getSampleRate(),
 	 			                                          format.getSampleSizeInBits() * 2,
 	 			                                          format.getChannels(),
 	 			                                          format.getFrameSize() * 2,
 	 			                                          format.getFrameRate(),
 	 			                                          true);
 	 			                stream = AudioSystem.getAudioInputStream(tmp, stream);
 	 			                format = tmp;
 	 			            }
 	 			            DataLine.Info info = new DataLine.Info(Clip.class, 
 	 			                                           stream.getFormat(),
 	 			                                           ((int) stream.getFrameLength() *
 	 			                                           format.getFrameSize()));

 	 			            currentSoundClip = (Clip) AudioSystem.getLine(info);
 	 			            currentSoundClip.open(stream);
 	 			        } catch (Exception ex) {
 	 			            currentSoundClip = null;
 	 			        }
 	 			        currentSoundClip.start();//play sound
 	 			        JOptionPane.showMessageDialog(mainPanel,title + "\n" +
 	 						   	"Date   : " + reminderCheckDate + "\n" +
 	 						   	"Time   : " + timing + "\n" +
 	 						   	"Venue : " + venue,
 	 		                    "Reminder",JOptionPane.INFORMATION_MESSAGE);
 	 			   }
 			   }
 			   stmt.close();
 		   }
 		   catch(Exception e) {
 			   System.out.println("ERROR => " + e.getMessage());
 		   }
 	 	    
 		   String str1 = "";
 		   String abc1 = "";
 		   try {
 			   BufferedReader in = new BufferedReader(new FileReader("Alarm.txt"));
 			   while ((str1 = in.readLine()) != null)
 			   { 
 			   		abc1 = str1;
 			   }//while end
 			   in.close();
 		   }//try end 
 		   catch (IOException e){
 			   System.out.println("error");  
 		   }
 			   
 		   if(displayTime.equals(abc1)) {
 			   String str2 = "";
 			   String abc2 = "";
 			   try {
 				   BufferedReader in = new BufferedReader(new FileReader("songName"));
 				   while ((str2 = in.readLine()) != null)
 				   { 
 					   abc2 = str2;
 				   }//while end
 				   in.close();
 				   
 			   }//try end 
 			   catch (IOException e){
 				   System.out.println("error");
 			   } 
 			   
 			   //start play song
 			   String fileName = abc2;
 			   File file = new File(fileName);
 			   
 			   try {
 				   AudioInputStream stream = AudioSystem.getAudioInputStream(file);
 				   AudioFormat format = stream.getFormat();
 				   
 				   if ((format.getEncoding() == AudioFormat.Encoding.ULAW) ||
 					   (format.getEncoding() == AudioFormat.Encoding.ALAW)) {
 					   AudioFormat tmp = new AudioFormat(
 							   AudioFormat.Encoding.PCM_SIGNED,
 							   format.getSampleRate(),
 							   format.getSampleSizeInBits() * 2,
 							   format.getChannels(),
 							   format.getFrameSize() * 2,
 							   format.getFrameRate(),
 							   true);
 					   stream = AudioSystem.getAudioInputStream(tmp, stream);
 					   format = tmp;
 				   }
 				   
 				   DataLine.Info info = new DataLine.Info(Clip.class,
 						   stream.getFormat(),
 						   ((int) stream.getFrameLength() * format.getFrameSize()));
 				   
 				   currentSoundClip = (Clip) AudioSystem.getLine(info);
 				   currentSoundClip.open(stream);
 			   }catch (Exception ex) {
 				   currentSoundClip = null;
 			   }
 			   
 			   currentSoundClip.start();
 			   JOptionPane.showMessageDialog(mainPanel,"ALARM","Alarm Clock",JOptionPane.INFORMATION_MESSAGE);
 		   }
 	   }
    }
    
    //Set the comboBox for Title in the GUI when the user clicks a date button
    private void setDateForGUI(String dateReceived) {
    	try {
    		Add.addEntryDate = dateReceived; //Get the date selected by the user from
            								 //  the Add Entry GUI
            
    		DeleteEntry.deleteTitleComboBox.removeAllItems();
            Edit.editTitleComboBox.removeAllItems();
            ViewEntry.viewTitleComboBox.removeAllItems();
            
            Statement stmt = con.createStatement();
            ResultSet rset = stmt.executeQuery("SELECT * FROM ENTRY WHERE E_DATE = '"
            		+  dateReceived + "'");

            //Output all the INVENTORY names in the combo box
            ViewEntry.viewTitleComboBox.insertItemAt(" ", 0);
            Edit.editTitleComboBox.insertItemAt(" ", 0);
        	DeleteEntry.deleteTitleComboBox.insertItemAt(" ", 0);
        	int i = 1;
            while(rset.next()) {
            	ViewEntry.viewTitleComboBox.insertItemAt(rset.getString(2), i);
            	Edit.editTitleComboBox.insertItemAt(rset.getString(2), i);
            	DeleteEntry.deleteTitleComboBox.insertItemAt(rset.getString(2), i);
                i++;
            }

            stmt.close();
        } catch (Exception ex) {
        	//Logger.getLogger(ConnectingDatabase.class.getName()).log(Level.SEVERE, null, ex);
        	System.out.println("ERROR => " + ex.getMessage());
        }
    }
    
    class PanelSwitchToAlarmClockSetting implements ActionListener {
		public void actionPerformed(ActionEvent ae) {
			CardLayout c = (CardLayout)(mainPanel.getLayout());
			c.show(mainPanel, "AlarmClockSetting");
		}
	}
    
    class PanelSwitchToEntryMenu implements ActionListener {
		public void actionPerformed(ActionEvent ae) {
			CardLayout c = (CardLayout)(mainPanel.getLayout());
			c.show(mainPanel, "EntryMenu");
		}
	}
    
    
    private JButton button1;
    private JButton button10;
    private JButton button11;
    private JButton button12;
    private JButton button13;
    private JButton button14;
    private JButton button15;
    private JButton button16;
    private JButton button17;
    private JButton button18;
    private JButton button19;
    private JButton button2;
    private JButton button20;
    private JButton button21;
    private JButton button22;
    private JButton button23;
    private JButton button24;
    private JButton button25;
    private JButton button26;
    private JButton button27;
    private JButton button28;
    private JButton button29;
    private JButton button3;
    private JButton button30;
    private JButton button31;
    private JButton button32;
    private JButton button33;
    private JButton button34;
    private JButton button35;
    private JButton button36;
    private JButton button37;
    private JButton button38;
    private JButton button39;
    private JButton button4;
    private JButton button40;
    private JButton button41;
    private JButton button42;
    private JButton button5;
    private JButton button6;
    private JButton button7;
    private JButton button8;
    private JButton button9;
    private JPanel datePanel;
    private JButton exitProgramButton;
    private JPanel greenPanel;
    private JLabel jLabel1;
    private JLabel jLabel10;
    private JLabel jLabel11;
    private JLabel jLabel12;
    private JLabel jLabel2;
    private JLabel jLabel3;
    private JLabel jLabel4;
    private JLabel jLabel5;
    private JLabel jLabel6;
    private JLabel jLabel7;
    private JLabel jLabel8;
    private JLabel jLabel9;
    private JPanel jPanel1;
    private JPanel legendPanel;
    private JLabel monthText;
    private JButton nextMonthButton;
    private JPanel pinkPanel1;
    private JButton previousMonthButton;
    private JPanel redPanel;
    private JButton refreshCalendarButton;
    private JButton setAlarmClockButton;
    private JButton soundSettingsButton;
    private JLabel timeDisplayLabel;
    private JComboBox yearComboBox;
}